function initCanvas()
{
	canvas.width = width;
	canvas.height = height;
	
    if (canvas.getContext) 
	{
		ctx = canvas.getContext('2d'); // Ïîëó÷àåì 2D êîíòåêñò
					
	
	}
	//imageData = ctx.getImageData(0, 0, width, height);
}
function drawTrails()
{
	height = im.height;
	width = im.width;

	initCanvas();
	ctx.drawImage(im, 0, 0);
		
	imageData = ctx.getImageData(0, 0, width, height);
}	
